package com.zzyl.mapper;


import com.github.pagehelper.Page;
import com.zzyl.entity.NursingLevel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingLevelMapper {
    @Select("select * from nursing_level")
   List<NursingLevel> listAll();

    void insert(NursingLevel nursingLevel);

    Page<NursingLevel> selectPage(String name, Byte status);

    @Select("select level.*,level.lplan_id as planId, plan.plan_name planName from nursing_level level left join nursing_plan plan on level.lplan_id = plan.id where  level.id = #{id}")
    NursingLevel selectByIdId(Long id);



    @Delete("delete from nursing_level where id = #{id}")
    void deleteById(Long id);


    void update(NursingLevel nursingLevel);
}